<?php
$file_contents = file('ip.merge.txt');
$str = '';
$n = $_GET['n'];
if(!$n){
	$n = 0;
}
$i = 0;
foreach($file_contents as $line){
	if($line){
		if ($i >= $n * 10000) {
			if ($i < ($n + 1) * 10000) {
				$str .= $line;
			}
		}
	}
	$i++;
}
file_put_contents('data/' . ($n + 1) . '.sql', $str);
header('Content-type:text/html;charset=utf-8');
echo '<meta http-equiv="refresh" content="1;url=1.php?n=' . ($n + 1) . '">';